package com.crayfish.quduo.model;

import com.crayfish.quduo.utils.SystemUtil;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

import cn.bmob.v3.BmobObject;

/**
 * 作者：crayfish(徐杰)
 * 描述：
 * Created by crayfish on 2017/3/31.
 */
@Entity
public class Test extends BmobObject{
    @Id
    public String id;
    public String ct;
    public String img;
    public String title;
    public String type;
    public int laud;
    public int comment;

    @Generated(hash = 627932584)
    public Test(String id, String ct, String img, String title, String type,
            int laud, int comment) {
        this.id = id;
        this.ct = ct;
        this.img = img;
        this.title = title;
        this.type = type;
        this.laud = laud;
        this.comment = comment;
    }

    @Generated(hash = 372557997)
    public Test() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCt() {
        return ct;
    }

    public void setCt(String ct) {
        this.ct = ct;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getLaud() {
        return laud;
    }

    public void setLaud(int laud) {
        this.laud = laud;
    }

    public int getComment() {
        return comment;
    }

    public void setComment(int comment) {
        this.comment = comment;
    }

    public static Test toTest(JokeItemBean.Item item){
        Test test = new Test();
        test.setId(item.getObjectId());
        test.setComment(item.getComment());
        test.setLaud(item.getLaud());
        test.setCt(item.getCt());
        test.setImg(item.getImg());
        test.setTitle(item.getTitle());
        test.setType(item.getType());
        test.setACL(item.getACL());
        test.setCreatedAt(item.getCreatedAt());
        test.setObjectId(item.getObjectId());
        test.setTableName(item.getTableName());
        test.setUpdatedAt(item.getUpdatedAt());
        return test;
    }

    public static JokeItemBean.Item toItem(Test test){
        JokeItemBean.Item item = new JokeItemBean.Item();
        item.setComment(test.getComment());
        item.setLaud(test.getLaud());
        item.setCt(test.getCt());
        item.setImg(test.getImg());
        item.setTitle(test.getTitle());
        item.setType(test.getType());
        item.setACL(test.getACL());
        item.setObjectId(test.getObjectId());
        item.setTableName(test.getTableName());
        return item;
    }
}
